/*
 * cirLinkedList.h
 *
 *  Created on: Nov 10, 2011
 *      Author: dpguimaraes
 */

#ifndef CIRLINKEDLIST_H_
#define CIRLINKEDLIST_H_
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "contact.h"

#define NOT_FOUND 0
#define FOUND 1

#define EMPTY_LIST 0
#define DELETE_SUCCESS 1

#define FIRST 0
#define LAST 1
#define EMAIL_ONE 2
#define EMAIL_TWO 3

#define OUT_OF_RANGE 0
#define EDIT_SUCCESS 1

typedef struct node{
	Contact *pCurrentContact;
	struct node *pPrevNode;
	struct node *pNextNode;
}Node;

typedef struct cirList{
	Node *pTopNode;
	Node *pCurrentNode;
	int numNodes;
}CirList;

void nextNode(CirList *pMyList);
void prevNode(CirList *pMyList);
void add(CirList *pMyList, Contact *pContact);
int delete(CirList *pMyList);
int edit(CirList *pMyList, char *editedData, int dataIndex);
int search(CirList *pMyList, char *lastName);
void sort(CirList *pMyList);
Node *findFirst(CirList *pMyList);
void swap(Node *node1, Node *node2);

#endif /* CIRLINKEDLIST_H_ */
